#!/usr/bin/perl
#
#

sub expand {
	my $s = shift;
	$s =~ s/S/SlSlS/g;
	$s =~ s/L/SLSLSLS/g;
	$s =~ s/l/L/g;
	$s;
}

my $times = int shift @ARGV;
my $sqrt2 = sqrt 2;
my $scale = 3 + 2 * sqrt 2;

my $o = 'LS';
my %k = (
	L => $sqrt2,
	S => 1,
);
for (0 .. $times) {
	my @i = split '', $o;
	my $n = 0;
	my @o;
	push @o, $n;
	for (@i) {
		$n += $k{$_};
		push @o, $n;
	}
	$n /= 2;
	@o = map { $_ - $n } @o;
	print join ' ', @o;
	print "\n";
	last if $_ == $times;
	$o = expand $o;
	$k{$_} /= $scale for keys %k;
}
